<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> 

<portlet:defineObjects />

<link rel="stylesheet" href="/css/xiupopo.css" type="text/css" media="all" />

<fmt:setLocale value="<%= renderResponse.getLocale().getLanguage() %>"/>
<fmt:setBundle basename="Language" var="msg"/>
<fmt:message bundle="${"${"}msg}" key="title" scope="session" var="title1" />
<% renderResponse.setTitle( (String)session.getAttribute("title1") ); %>

<portlet:resourceURL var="imageUrl" id="resource">
	<portlet:param name="parentFolder" value="item_parentFolder"/>
	<portlet:param name="fileName" value="item_fileFile"/>
</portlet:resourceURL>

<f:view locale="${"#{"}facesContext.externalContext.request.locale}">

<f:loadBundle basename="Language" var="msgs" />

<%@ include file="navigation.jspf"%>

<div>
<h:dataTable value="${"#{"}${pojo.getDeclarationName()?uncap_first}Bean.${pojo.getDeclarationName()?uncap_first}List}" var="item" border="1">

<#foreach field in pojo.getAllPropertiesIterator()>
<#if pojo.getJavaTypeName(field, jdk5).equals("String") || pojo.getJavaTypeName(field, jdk5).equals("long")>
	<h:column footerClass="footerClass" headerClass="headerClass">
		<f:facet name="header">
			<h:outputText value="${field.name}" />
		</f:facet> 
			<h:outputText value="${"#{"}item.${field.name}}"></h:outputText>
	</h:column>
</#if>
</#foreach>
	<h:column>
		<f:facet name="header">
			<h:outputText value="Action" />
		</f:facet>
		<h:form>
			<h:commandLink action="${"#{"}${pojo.getDeclarationName()?uncap_first}Bean.deleteAction}" value="${"#{"}msgs.button_delete}">
				<f:param name="${pojo.getDeclarationName()?uncap_first}_id" value="${"#{"}item.id}"/>
			</h:commandLink>
		</h:form>
	</h:column>
	<h:column>
		<f:facet name="header">
			<h:outputText value="Action" />
		</f:facet>
		<h:form>
			<h:commandLink action="${"#{"}${pojo.getDeclarationName()?uncap_first}Bean.readAction}" value="${"#{"}msgs.button_edit}">
				<f:param name="${pojo.getDeclarationName()?uncap_first}_id" value="${"#{"}item.id}"/>
			</h:commandLink>
		</h:form>
	</h:column>
</h:dataTable>
</div>

</f:view>
